﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QianBuo.Lottery.Web.Areas.Manage.Models.ChaseTaskModels.DetailModel>" %>
<%@ Import Namespace="Code.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	追号任务详情
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <a class="a_blue" href='<%=Request["ReturnUrl"]??Url.Action("Index") %>'>&gt;&gt;返回</a>
        <%if (ViewData.ModelState.IsValid && Model.Task!=null)%>
        <%{%>
        <table class="table" width="100%">
            <tr class="th"><td colspan="8" align="left">追号任务详情</td></tr>
            <tr>
                <td align="right">追号用户：</td>
                <td align="left"><%=Model.Task.UserName %></td>
                <td align="right">购买日期：</td>
                <td align="left"><%=Model.Task.AddTime.ToString("yyyy-MM-dd HH:mm:ss") %></td>
                <td align="right">彩种：</td>
                <td align="left"><%=Model.Task.LotteryType.GetName() %></td>
                <td align="right">元角模式：</td>
                <td align="left"><%=Model.Task.RatioName %></td>
            </tr>
            <tr>
                <td align="right">追号期数：</td>
                <td align="left"><%=Model.Task.ChaseCount %></td>
                <td align="right">执行期数：</td>
                <td align="left"><%=Model.Task.ExecuteCount %></td>
                <td align="right">撤销期数：</td>
                <td align="left"><%=Model.Task.CancleCount %></td>
                <td align="right">奖金模式：</td>
                <td align="left"><%=Model.Task.WinModelName %></td>
            </tr>
            <tr>
                <td align="right">任务金额：</td>
                <td align="left"><%=Model.Task.TaskMoney.ToString("F") %></td>
                <td align="right">任务状态：</td>
                <td align="left"><%=Model.Task.State.GetName() %></td>
                <td align="right">中奖后中止：</td>
                <td align="left"><%=Model.Task.StopWin >= 0 ? "是" : "否"%></td>
                <td align="right">终止时间：</td>
                <td align="left"><%=string.Format("{0:yyyy-MM-dd HH:mm:ss}",Model.Task.StopTime) %></td>
            </tr>
            <tr>
                <td align="right">操作：</td>
                <td align="left" colspan="7">
                    <%=Model.Task.State == ChaseTaskState.Normal ? Html.ActionLink("系统撤消", "Stop", Url.Route(new { Model.Task.ID, returnurl = Request.RawUrl }), Url.Route(new { @class = "a_blue", onclick = "return confirm('资金将返还给用户，此操作不可回滚。\\r\\n确定要撤销此任务吗？')" })) : MvcHtmlString.Empty%>
                </td>
            </tr>
        </table>
        <p />
        <table class="table" width="100%">
            <tr class="th"><th>玩法</th><th>投注号码</th><th>注数</th><th>返点加奖</th><th>单倍金额</th></tr>
            <% foreach (var item in Model.Numbers)%>
            <% {%>
		    <tr>
                <td><%=item.PlayName %></td>
                <td align="left"><div class="numberitem"><%=item.Number %></div></td>
                <td><%=item.Count %>注</td>
                <td><%=item.BackMoneyToWinMoney.HasValue ? item.BackMoneyToWinMoney + "%" : "--" %></td>
                <td align="right"><%=item.SingleMoney.ToString("F") %></td>
            </tr>
	        <% }%>
        </table>
        <p />
        <table class="table" width="100%">
            <tr class="th"><th>期号</th><th>倍数</th><th>金额</th><th>状态</th><th>开奖号码</th><th>操作</th></tr>
            <% foreach (var item in Model.Details)%>
            <% {%>
		    <tr class='<%=item.ID.ToString()==Request["DetailID"]?"selected":"" %>'>
                <td><%=item.IssueName %></td>
                <td align="left"><%=item.Multiply %></td>
                <td><%=item.Money.ToString("F") %></td>
                <td><%=item.State.GetName() %></td>
                <td><%=item.OpenCode %></td>
                <td>
                    <%=item.State == ChaseTaskState.Normal ? Html.ActionLink("系统撤消", "Cancle", Url.Route(new { item.ID, returnurl = Request.RawUrl }), Url.Route(new { @class = "a_blue", onclick = "return confirm('资金将返还给用户，此操作不可回滚。\\r\\n确定要撤销此任务吗？')" })) : MvcHtmlString.Empty%>
                    <%=item.IsTimeNow && item.State == ChaseTaskState.Normal ? Html.ActionLink("执行", "Execute", Url.Route(new { ID = item.ChaseTaskID, returnurl = Request.RawUrl }), Url.Route(new { @class = "a_blue", onclick = "return confirm('确定要执行此任务吗？')" })) : MvcHtmlString.Empty%>
                    <%=item.State == ChaseTaskState.Executed ? Html.ActionLink("详情", "Detail","Scheme", Url.Route(new { ID=item.SchemeID, returnurl = Request.RawUrl }), Url.Route(new { @class = "a_blue" })) : MvcHtmlString.Empty%>
                </td>
            </tr>
	        <% }%>
            <tr>
                <td colspan="5">
                    <%=Html.Pager(Model.Page,Model.PageSize,Model.SumCount,"Page",null) %>
                </td>
            </tr>
        </table>
        <%}%>
        <%else%>
        <%{%>
        <table class="table" width="100%">
            <tr>
                <td>
                    <%=Html.ValidationSummary()%>
                </td>
            </tr>
        </table>
        <%} %>
    </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="StyleAndScript" runat="server">
</asp:Content>
